126
Beginner’s Guide to Code Algorithms
126
STEP 3
For mm = 1 To kk
If Left(Worksheets(“ShapeList”).Cells(mm, 3), 2) = “##” Then
Worksheets(“ShapeList”).Cells(mm, 3) = Mid(Worksheets(“ShapeList”).
Cells(mm, 3), 3, 100)
For Each shp In ActiveSheet.Shapes(Worksheets(“ShapeList”).Cells(mm,
3)).GroupItems
kk = kk + 1
Call GetRows(kk, shp)
Next shp
End If
Next
End Sub
Sub GetRows(kk, shp)
Worksheets(“ShapeList”).Cells(kk, 1) = shp.AutoShapeType
k = UBound(msoAutoShapeTypeName)
Call FindAutoShapeType(kk)
Worksheets(“ShapeList”).Cells(kk, 2) = shp.Type
k = UBound(msoShapeTypeName)
Call FindShapeType(kk)
Worksheets(“ShapeList”).Cells(kk, 3) = shp.Name
On Error GoTo bypass
a = shp.GroupItems.Count
If a <> ““ Then
Worksheets(“ShapeList”).Cells(kk, 3) = “##” & shp.Name
End If
On Error GoTo bypass
Worksheets(“ShapeList”).Cells(kk, 4) = shp.TextEffect.Text
bypass:
‘Worksheets(“ShapeList”).Cells(kk, 4) = shp.GroupItems.Count
Resume Next
End Sub
Sub FindShapeType(kk)
FoundInstance = 0
For i = 1 To k
If k > 1 And msoShapeTypeValue(i) + 0 = Worksheets(“ShapeList”).Cells(kk,
2) Then
FoundInstance = 1
Worksheets(“ShapeList”).Cells(kk, 2) = msoShapeTypeName(i)
Exit For
Else
FoundInstance = 0
End If
Next
End Sub
Sub FindAutoShapeType(kk)
FoundInstance = 0